package org.light.utils;

import org.light.domain.Type;

public class TypeUtil {
	public static boolean isNumeric(Type type){
		if (type.getTypeName().equals("int")||type.getTypeName().equals("int32")||type.getTypeName().equalsIgnoreCase("int64")||type.getTypeName().equalsIgnoreCase("float")||
				type.getTypeName().equalsIgnoreCase("float32")||type.getTypeName().equalsIgnoreCase("float64")){
			return true;
		}else {
			return false;		
		}		
	}
	
	public static String findNullType(String typeName) {
		switch (typeName) {
		case "bool": 
			return "NullBool";
		case "string": 
			return "NullString";
		case "int64": 
			return "NullInt64";
		case "float64": 
			return "NullFloat64";
		case "int32": 
			return "NullInt32";
		default:
				return typeName;
		}
	}
}
